<template>
    <van-nav-bar title="标题"
                 left-text="返回"
                 left-arrow
                 @click-left="onClickLeft"
                 @click-right="onClickRight" >
        <template #right>
            <van-icon name="search" size="18" />
        </template>
    </van-nav-bar>
    <div>
        <router-view></router-view>
    </div>

<!--    todo 切换图标-->
    <van-tabbar v-model="active" @change="onChange">
        <van-tabbar-item to="/"  icon="home-o" >主页</van-tabbar-item>
        <van-tabbar-item to="/team" icon="search">队伍</van-tabbar-item>
        <van-tabbar-item to="/user" icon="friends-o">个人</van-tabbar-item>
    </van-tabbar>

</template>

<script setup lang="ts">
import {showToast} from "vant";
import {ref} from "vue";
import {useRouter} from "vue-router";



let router = useRouter();


const onClickLeft = () => history.back();
const onClickRight = () =>{
    router.push({
        path:'/search'
    })
}

const active = ref(0);
const onChange = (index) => showToast(`标签 ${index}`);
</script>

<style scoped>

</style>